
[dbo].[LicenseOrganization]
CREATE TABLE [dbo].[LicenseOrganization]
(
[LicenseOrganizationKey] [uniqueidentifier] NOT NULL,
[Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ContactKey] [uniqueidentifier] NULL,
[Description] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_LicenseOrganization_Description] DEFAULT (''),
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LicenseOrganization] ADD CONSTRAINT [PK_LicenseOrganization] PRIMARY KEY CLUSTERED ([LicenseOrganizationKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LicenseOrganization_ContactKey] ON [dbo].[LicenseOrganization] ([ContactKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LicenseOrganization_CreatedByUserKey] ON [dbo].[LicenseOrganization] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LicenseOrganization_UpdatedByUserKey] ON [dbo].[LicenseOrganization] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LicenseOrganization] ADD CONSTRAINT [FK_LicenseOrganization_ContactMain] FOREIGN KEY ([ContactKey]) REFERENCES [dbo].[ContactMain] ([ContactKey])
GO
ALTER TABLE [dbo].[LicenseOrganization] ADD CONSTRAINT [FK_LicenseOrganization_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[LicenseOrganization] ADD CONSTRAINT [FK_LicenseOrganization_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO